<template>
	<div class="item" @click="go">
		<div>
			<span class="label">物料编码:</span>
			<span class="value">{{value.code}}</span>
		</div>
		<div>
			<span class="label">物料名称:</span>
			<span class="value">{{value.name}}</span>
		</div>
		<div>
			<span class="label">物料规格:</span>
			<span class="value">{{value.spec}}</span>
		</div>
		<div>
			<span class="label">存储货位:</span>
			<span class="value">{{value.loc}}</span>
		</div>
		<div class="btn" @click="go">盘点</div>
		
	</div>
</template>

<script setup>
	import {useRouter} from 'vue-router'
	const router=useRouter();
	//声明属性
	const props = defineProps({
		value: {
			type: Object,
			required: false,
			default: () => {
				return {
					id: 0,
					code: "",
					name: "",
					spec: "",
					loc: ""
				}
			}

		}
	});
	
	function go(){
		router.push({"path":"/inventoryContent"});
	}
</script>

<style scoped>
	.status {
		float: right;
		color: #666;
	}

	.item {
		width: 7.5rem;
		height: 2.8rem;
		background-color: #fff;
		margin: 0.2rem auto;
		border-radius: 0.15rem;
		font-size: 0.3rem;
		color: #333;
		padding-top: 0.2rem;
	}

	.item div {
		height: 0.5rem;
		line-height: 0.5rem;
		margin: 0 0.2rem;
	}

	.label {
		color: #666;
	}

	.value {
		margin-left: 0.1rem;
	}
    .btn{
		display: inline-block;
		width: 1.2rem;
		height: 1.2rem;
		line-height: 1.2rem;
		background-color: #FF6600;
		color: #fff;
		text-align: center;
		float: right;
	}

</style>
